package com.ftg.learn.day11;

import java.io.*;
import java.lang.reflect.Field;
import java.util.Random;
import java.util.UUID;

/**
 * file相关操作
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/8/17 下午1:07
 */
public class FileIo {

    public static void main(String[] args) throws IOException {
//        Field File

//        window -- > file管理
        for (int i = 0; i < 10; i++) {
            File f1 = new File("/home/kangjx/Desktop/tt"+i+".txt");
            if (!f1.exists()) {
                f1.createNewFile();
            }

            OutputStream os  = new FileOutputStream(f1);
            String a1 = "zhangsanfeng i love u";
            char[] chars = a1.toCharArray();
            for (int i1 = 0; i1 < chars.length; i1++) {
                os.write(chars[i1]);
            }
            os.close();

            System.out.println(UUID.randomUUID().toString());
        }


    }

}
